<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta property="og:title" content="Oracle在生产上的那些坑" />
<meta property="og:description" content="Oracle Dos 常见错误 dpiStmt_execute: ORA-01427: single-row sub query returns more than one row
ORA-01427：单行子查询返回多行
query sql error: ORA-00000: DPI-1072: the Oracle Client library version is unsupported
​	DPI-1072：Oracle客户端库不支持稀有版本，使用select * from v$version 查询Oracle数据库版本，然后去官网下载instantclient-basic-windows.x64-版本.zip，也就是临时客户端，注意64位适配32位。
query sql error: dpoPool_create user=system extAuth=0: ORA-12154: TNS:could not resolve the connect identifier specified
TNS：无法解析指定的连接标识符，注意配置的数据库连接参数。query sql error: ORA-00000: DPI-1047: Cannot locate a 64-bit Oracle Client library: &quot;The specified module could not be found&quot;.
​	程序是编译的64位，客户端也必须是64位，所以提示为找不到64位Oracle Client库，需要添加一下环境变量或者连接配置。
编程语言操作 JAVA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 public class Oracle { public Connection conn() { String USERNAMR = &#34;system&#34;; String PASSWORD = &#34;manager&#34;; String URL = &#34;jdbc:oracle:thin:@188." />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://wuju-i.gitee.io/post/20240422-oracle-1/" /><meta property="article:section" content="post" />
<meta property="article:published_time" content="2024-04-23T00:00:00+00:00" />
<meta property="article:modified_time" content="2024-04-23T00:00:00+00:00" />

  <meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Oracle在生产上的那些坑"/>
<meta name="twitter:description" content="Oracle Dos 常见错误 dpiStmt_execute: ORA-01427: single-row sub query returns more than one row
ORA-01427：单行子查询返回多行
query sql error: ORA-00000: DPI-1072: the Oracle Client library version is unsupported
​	DPI-1072：Oracle客户端库不支持稀有版本，使用select * from v$version 查询Oracle数据库版本，然后去官网下载instantclient-basic-windows.x64-版本.zip，也就是临时客户端，注意64位适配32位。
query sql error: dpoPool_create user=system extAuth=0: ORA-12154: TNS:could not resolve the connect identifier specified
TNS：无法解析指定的连接标识符，注意配置的数据库连接参数。query sql error: ORA-00000: DPI-1047: Cannot locate a 64-bit Oracle Client library: &quot;The specified module could not be found&quot;.
​	程序是编译的64位，客户端也必须是64位，所以提示为找不到64位Oracle Client库，需要添加一下环境变量或者连接配置。
编程语言操作 JAVA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 public class Oracle { public Connection conn() { String USERNAMR = &#34;system&#34;; String PASSWORD = &#34;manager&#34;; String URL = &#34;jdbc:oracle:thin:@188."/>

  
  <meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
  <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#262d33">
  <title>
    
    橘子的博客 - Oracle在生产上的那些坑
    
  </title>
  
  <link rel="shortcut icon" href="g.png" type="image/x-icon" />
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&display=swap"
    rel="stylesheet">
  
  
  
  <link rel="stylesheet" href="/minima.1714031344.css">

  
  
  <script defer type="text/javascript" src="/minima.1714031344.js"></script>
</head>
<script>
  
  let theme_2b_used = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';

  try {
    if (!('theme' in localStorage)) {
      const default_theme = '';
      
      
      if (default_theme === 'dark' || default_theme === 'light') {
        theme_2b_used = default_theme;
      }

      
      localStorage.theme = theme_2b_used;
    }
    
    document.querySelector('html').classList.add(localStorage.theme);
  } catch (e) {
    console.error(e);
  }
</script>


<body class=" sm:mx-5 sm:my-0">
  <header class="flex justify-between items-center mb-6 sm:my-3">
  <div class="flex items-center">
    
    <div id="theme-switcher" class="text-4xl cursor-pointer">🌑</div>
  </div>
  <nav class="flex items-center
    whitespace-nowrap overflow-x-auto overflow-y-hidden">
    
    <a class="ml-5" href="/">首页</a>
    
    <a class="ml-5" href="/categories">分类</a>
    
    <a class="ml-5" href="/log">日记</a>
    
    <a class="ml-5" href="/about">关于</a>
    
  </nav>
</header>
  
  

<h1 class="mt-6 mb-6">Oracle在生产上的那些坑</h1>
<div class="mb-3 text-xs flex justify-between sm:flex-col">
	<div>
	
		Posted at &mdash; 24年 4月23日
	
		
	</div>
	
</div>
<main>
	<p></p>
	<article class="md">
		<h1 id="oracle-dos">Oracle Dos</h1>
<h2 id="常见错误">常见错误</h2>
<ul>
<li>
<p><code> dpiStmt_execute: ORA-01427: single-row sub query returns more than one row</code></p>
<p>ORA-01427：单行子查询返回多行</p>
</li>
<li>
<p><code>query sql error:  ORA-00000: DPI-1072: the Oracle Client library version is unsupported</code></p>
</li>
</ul>
<p>​		DPI-1072：Oracle客户端库不支持稀有版本，使用<code>select * from v$version</code> 查询Oracle数据库版本，然后去官网下载<code>instantclient-basic-windows.x64-版本.zip</code>，也就是临时客户端，注意64位适配32位。</p>
<ul>
<li>
<p><code>query sql error:  dpoPool_create user=system extAuth=0: ORA-12154: TNS:could not resolve the connect identifier specified</code></p>
<pre><code>  TNS：无法解析指定的连接标识符，注意配置的数据库连接参数。
</code></pre>
</li>
<li>
<p><code>query sql error:  ORA-00000: DPI-1047: Cannot locate a 64-bit Oracle Client library: &quot;The specified module could not be found&quot;.</code></p>
</li>
</ul>
<p>​		程序是编译的64位，客户端也必须是64位，所以提示为找不到64位Oracle Client库，需要添加一下环境变量或者连接配置。</p>
<h2 id="编程语言操作">编程语言操作</h2>
<h3 id="java">JAVA</h3>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">Oracle</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl">	<span class="kd">public</span> <span class="n">Connection</span> <span class="nf">conn</span><span class="o">()</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl">		<span class="n">String</span> <span class="n">USERNAMR</span> <span class="o">=</span> <span class="s">&#34;system&#34;</span><span class="o">;</span>
</span></span><span class="line"><span class="cl">		<span class="n">String</span> <span class="n">PASSWORD</span> <span class="o">=</span> <span class="s">&#34;manager&#34;</span><span class="o">;</span>
</span></span><span class="line"><span class="cl">		<span class="n">String</span> <span class="n">URL</span> <span class="o">=</span> <span class="s">&#34;jdbc:oracle:thin:@188.188.188.83:1521:DBSERVER&#34;</span><span class="o">;</span>
</span></span><span class="line"><span class="cl">		<span class="c1">// 创建一个数据库连接
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>		<span class="n">Connection</span> <span class="n">connection</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
</span></span><span class="line"><span class="cl">		<span class="k">try</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl">			<span class="n">Class</span><span class="o">.</span><span class="na">forName</span><span class="o">(</span><span class="s">&#34;oracle.jdbc.driver.OracleDriver&#34;</span><span class="o">);</span>
</span></span><span class="line"><span class="cl">			<span class="k">try</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl">				<span class="n">connection</span> <span class="o">=</span> <span class="n">DriverManager</span><span class="o">.</span><span class="na">getConnection</span><span class="o">(</span><span class="n">URL</span><span class="o">,</span> <span class="n">USERNAMR</span><span class="o">,</span> <span class="n">PASSWORD</span><span class="o">);</span>
</span></span><span class="line"><span class="cl">			<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">SQLException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl">				<span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
</span></span><span class="line"><span class="cl">			<span class="o">}</span>
</span></span><span class="line"><span class="cl">			<span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&#34;成功连接数据库&#34;</span><span class="o">);</span>
</span></span><span class="line"><span class="cl">		<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">ClassNotFoundException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl">			<span class="k">throw</span> <span class="k">new</span> <span class="n">RuntimeException</span><span class="o">(</span><span class="s">&#34;class not find !&#34;</span><span class="o">,</span> <span class="n">e</span><span class="o">);</span>
</span></span><span class="line"><span class="cl">		<span class="o">}</span>
</span></span><span class="line"><span class="cl">		<span class="k">return</span> <span class="n">connection</span><span class="o">;</span>
</span></span><span class="line"><span class="cl">	<span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span></code></pre></td></tr></table>
</div>
</div>
	</article>
</main>





	

	

	



  <footer class="mt-8 flex sm:flex-col-reverse justify-between items-center">
  <p class="mt-0 text-sm">
    © 2022 | 橘子
    
  </p>
  <p class="flex items-center mt-0">
    
  </p>
</footer>
</body>
</html>